//
//  NSObject+SQModel_id.h
//  SQLiteForOCModel
//
//  Created by 唐健 on 2018/10/3.
//  Copyright © 2018年 唐健. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MJExtension/MJExtension.h>
#import <UIKit/UIKit.h>


@protocol SQModel_id <NSObject>

@required
/**
 需要实现get方法 制定当前模型的一个属性作为存储主键
 */
@property (readonly) NSString *SQModel_id;


/**
 存储、删除、查找的方法
 底层已经实现 不需要重写方法
 仅作为方法调用的限制 只有模型类准守此协议时才能显式调用
 */

@optional

- (void)sq_save:(void(^)(BOOL isSuccess))saveResult;
+ (void)sq_save:(NSObject *)obj saveResult:(void (^)(BOOL isSuccess))result;

+ (void)sq_deleteForSQModel_id:(NSString *)SQModel_id deleteResult:(void (^)(BOOL isSuccess))result;
+ (void)sq_deleteAllSQModelDeleteResult:(void (^)(BOOL isSuccess))result;

+ (void)sq_selectAllSQModelSelectResult:(void (^)(NSArray *objs))result;
+ (void)sq_selectForSQModel_id:(NSString *)SQModel_id selectResult:(void (^)(id obj))result;


@end



@interface NSObject (SQModel_id)




@end
